package org.csmzxy233401;

class Animal {
    public void speak(){
        System.out.println("动物的叫声");
    }
}
class Cat extends Animal{
    @Override
    public void speak(){
        System.out.println("小猫：喵喵……");
    }
}
class Dog extends Animal{
    @Override
    public void speak(){
        System.out.println("小狗：汪汪……");
    }
}

public class example13 {
    public static void main(String[] args){
        Animal animal1 = new Cat();
        Animal animal2 = new Dog();
        animal1.speak();
        animal2.speak();
    }
}